<?php
/**
 * Created by JetBrains PhpStorm.
 * User: zhouyang
 * Date: 13-9-7
 * Time: 下午4:31
 * To change this template use File | Settings | File Templates.
 */
class TrendsDB  extends DBReader{

    //根据trend_id 获取trend 信息
    public function get($trend_id){

        $sql = 'select trend_id, source_id, title, link, trend_type, update_time, user_id from trends where trend_id = :trend_id';

        return $this->db()->getRow($sql,array('trend_id'=>$trend_id));
    }

    //获取trend 列表<带分页>
    public function getTrendList($num = 30){
        $sql = 'select trend_id, source_id, title, link, trend_type, update_time, user_id from trends';

        return $this->db()->selectLimit($sql,$num);
    }
}